#!/bin/bash
if [ ! -d /tools/httpetc ]
then
    mkdir /tools/httpetc
fi

if [ ! -d /sites ]
then
    mkdir /sites
fi

mkdir /sites/booenoa

cat > /tools/httpetc/booenoa.com.conf <<EOF
NameVirtualHost *:80
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/sites/booenoa"
    ServerName booenoa.fc
    ServerAlias www.booenoa.fc
    ErrorLog "|/tools/httpd/bin/rotatelogs /tools/data/logs/booenoa/%Y-%m-%d/error.%H-%M.log 50M"
    CustomLog "|/tools/httpd/bin/rotatelogs /tools/data/logs/booenoa/%Y-%m-%d/access.%H-%M.log 50M" common
</VirtualHost>
EOF

echo 'Include /tools/httpetc/booenoa.com.conf' >> ${HTTPD_CONF}
